<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>index.jsp</title>
<link rel="stylesheet" type="text/css" href="../css/user.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="../script/jquery.validate.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$('#saveBtn').click(function(){
			if($('#loginForm').valid()){
				var formValue = $('#loginForm input[type!=button]');
				var params = {};
				formValue.each(function(){
					params[this.name] = this.value; 
				});
				$.post('./save.do',params).done(function(data){
					var obj = $.parseJSON(data);
					if(obj.success) {
						$('table').hide();
					}
				});
			}
		});
		
		$('#answerBtn').click(function(){
			window.location.href = '../answer/questionlistView.do';
		});
		$('#scoreBtn').click(function(){
			window.location.href = 'new-score-list.do';
		});
		$('#profileBtn').click(function(){
			window.location.href = './edit.do';
		});
	});
</script>
</head>

<body>
	<center>
		<form action="./save.do" method="post" id='loginForm'>
			<img src="../image/4029.png" width="310"/>
			<div class='foot'>
				<span><input type='button' value='我要解答' id='answerBtn' /></span>
				<span><input type='button' value='我的评分' id='scoreBtn' class="${hasNewAnswer?'news':'' }"/></span>
				<span><input type='button' value='我的资料' id='profileBtn'/></span>
			</div>
			<table class='dataintable' style="display:${firstBind?'block':'none'};">
				<tr>
					<th><input placeholder='名字' name='name' required maxlength=15 /></th>
				</tr>
				<tr>
					<th><input placeholder='年龄' name='age' max=100 min=0 required /></th>
				</tr>
				<tr>
					<th><input placeholder='所在企业' name='company' maxlength = 100/></th>
				</tr>
				<tr>
					<th><input placeholder='职位' name='title' maxlength=50/></th>
				</tr>
				<tr>
					<th><input placeholder='所属行业' name='profession' maxlength=500 /></th>
				</tr>
				<tr>
					<th><textarea placeholder='企业业务介绍' name='companyIntroduction' maxlength=500></textarea></th>
				</tr>
				<tr>
					<td align="center">
						<input type='button' value='提交' id='saveBtn'/>
						<input type='hidden' value='1' name='groupid'/>
						<input type='hidden' value='${username }' name='username'/>
						<input type='hidden' value='${icon }' name='icon'/>
						<input type='hidden' value='${gender }' name='gender'/>
					</td>
				</tr>
			</table>
		</form>
	</center>
</body>
</html>
